import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:curved_labeled_navigation_bar/curved_navigation_bar.dart';
import 'package:curved_labeled_navigation_bar/curved_navigation_bar_item.dart';
import 'package:flutter/material.dart';
import 'package:untitled/Page/mine/mine_page.dart';
import 'package:untitled/font/mine_font.dart';
import 'action_bar_controller.dart';

class ActionBar extends StatelessWidget {
  final ActionBarController controller = Get.put(ActionBarController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Obx(() {
        return controller.tabArr[controller.selectedIndex.value];
      }),
      bottomNavigationBar: CurvedNavigationBar(
        items: [
          CurvedNavigationBarItem(
              child: Icon(
            MineFont.friends,
            color: Colors.blue,
          )),
          CurvedNavigationBarItem(
              child: Icon(
            MineFont.raway,
            color: Colors.blue,
          )),
          CurvedNavigationBarItem(
              child: Icon(
            MineFont.together,
            color: Colors.blue,
          ))
        ],
        index: controller.selectedIndex.value,
        height: 50,
        color: Colors.white,
        buttonBackgroundColor: Colors.white,
        backgroundColor: const Color.fromARGB(0, 0, 0, 0),
        // backgroundColor: Color.fromARGB(0, 68, 137, 255),
        animationCurve: Curves.fastLinearToSlowEaseIn,
        animationDuration: const Duration(milliseconds: 500),
        onTap: controller.changeIndex,
      ),
    );
  }
}
